<div class="form-group">
<label class="col-sm-1 control-label">模块列表<label><input id="select-all" type="checkbox" value="1" checked="checked" name="select-all">全选</label></label>
<div class="col-sm-11" id="checkbox-lab-list">
<?php
    foreach($rs as $val){
?>
   <label class="checkbox-lab"><input type="checkbox" value="<?php echo $val['n_model'].'|'.$val['nid'];?>" checked="checked" name="model[]"> <?php echo $val['c_model'];?></label>
<?php }?>
</div>
</div>
<script>
$("#select-all").click(function(){
	var str=$(this).is(':checked')?'checked':false;
	//console.log($(this).attr("checked"));
	$("#checkbox-lab-list").find("input[type='checkbox']").prop('checked', str);
})
</script>